Skip to content

Conversation

@leigaol
Copy link
Contributor

@leigaol leigaol commented Mar 31, 2025

Problem

We did not utilize server side compute to help improve the quality of inline completion, chat, etc.

Solution

  1. Add server side project context support.

  • Treat all work as PUBLIC. Private feature/x branches will not be squash-merged at release time.
  • Your code changes must meet the guidelines in CONTRIBUTING.md.
  • License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

@leigaol leigaol requested review from a team as code owners March 31, 2025 19:03
@leigaol leigaol marked this pull request as draft March 31, 2025 19:03
@github-actions
Copy link

  • This pull request modifies code in src/* but no tests were added/updated.
    • Confirm whether tests should be added or ensure the PR description explains why tests are not required.

async function getWorkspaceId(editor: vscode.TextEditor): Promise<string | undefined> {
try {
const workspaceIds: { workspaces: { workspaceRoot: string; workspaceId: string }[] } =
await vscode.commands.executeCommand('aws.amazonq.getWorkspaceId')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this a command instead of a plain function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid cyclic dependency. The Flare LSP code was in the packages/amazonq which imports packages/core, but the CW code here is in packages/core.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if the command isn't defined? Sometimes there are startup ordering issues which result in "command not found" errors. Using a plain function would avoid that and add confidence.

There are more robust ways of avoiding cyclic dependencies. Commands should be a last resort.

rli pushed a commit to aws/aws-toolkit-jetbrains that referenced this pull request Apr 1, 2025
1. Add the settings of workspace context. (String of the settings to be adjusted based on product spec)
2. Let inline completion use workspaceId.

Before launch date, future workspace context PRs will target branch feature/q-lsp directly. 

VSC ref: aws/aws-toolkit-vscode#6894
Comment on lines +14 to +15
manifestUrl: 'https://aws-toolkit-language-servers.amazonaws.com/remoteWorkspaceContext/0/manifest.json',
supportedVersions: '^1.0.0',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this the final URL or will /codewhisperer/ gain the features from the temporary /remoteWorkspaceContext/ artifact (then this version would be 3.x) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is final, to my knowledge.

Copy link

@ege0zcan ege0zcan Apr 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now this is the final URL but I imagine we will need to change the URL in the near future because new artifacts are also being built

Copy link
Contributor

@justinmk3 justinmk3 Apr 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the name is pretty confusing. this defaultAmazonQLspConfig LSP bundle will be used for all Q features, not only "workspace indexing", right?

will this URL also have the upcoming "agentic chat" capabilities?

@leigaol leigaol marked this pull request as ready for review April 17, 2025 16:24
@leigaol leigaol changed the title WIP: feat(amazonq): workspace context feat(amazonq): remote workspace context Apr 17, 2025
@github-actions
Copy link

  • This pull request modifies code in src/* but no tests were added/updated.
    • Confirm whether tests should be added or ensure the PR description explains why tests are not required.
  • This pull request implements a feat or fix, so it must include a changelog entry (unless the fix is for an unreleased feature). Review the changelog guidelines.
    • Note: beta or "experiment" features that have active users should announce fixes in the changelog.
    • If this is not a feature or fix, use an appropriate type from the title guidelines. For example, telemetry-only changes should use the telemetry type.

Comment on lines +192 to +194
client.sendNotification('workspace/didCreateFiles', {
files: e.files.map((it) => {
return { uri: it.fsPath }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this event trigger for in-memory (non-file) editors? If so, should those be skipped, since the LSP can't do anything with them unless we send the file contents?

Comment on lines +162 to +167
client.info(
`Client: Updated Amazon Q Profile ${AuthUtil.instance.regionProfileManager.activeRegionProfile?.arn} to Amazon Q LSP`,
result
)
} catch (err) {
client.error('Error when setting Q Developer Profile to Amazon Q LSP', err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

non-blocker/future reference: these should probably be logged in logger, not client

Copy link
Contributor

@jpinkney-aws jpinkney-aws left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merging to prepare mainline for ssc

@jpinkney-aws jpinkney-aws merged commit b4de24f into aws:master Apr 17, 2025
30 of 31 checks passed
brdskggs pushed a commit to brdskggs/aws-toolkit-vscode that referenced this pull request Apr 28, 2025
## Problem
We did not utilize server side compute to help improve the quality of
inline completion, chat, etc.

## Solution
1. Add server side project context support.

---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants